package com.john.pplay.util;

public class Position {
    private float x;
    private float y;

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }
    public Position(){
        this(0,0);
    }
    public Position(float x,float y){
        this.x = x;
        this.y = y;
    }

    public Position minus(Position p){
        if (p == null) {
            return new Position();
        }else{
            return new Position(x-p.getX(),y-p.getY());
        }
    }

}
